# Create directory structure
$directories = @(
    "config",
    "modules/base",
    "modules/chat",
    "modules/translation",
    "modules/text",
    "modules/image",
    "modules/voice",
    "utils",
    "services",
    "web/templates/components",
    "web/static/css",
    "web/static/js",
    "web/static/assets",
    "tests/unit",
    "tests/integration"
)

foreach ($dir in $directories) {
    New-Item -ItemType Directory -Path $dir -Force
}

# Create Python files
$pythonFiles = @(
    "config/__init__.py",
    "config/settings.py",
    "modules/base/__init__.py",
    "modules/base/base_model.py",
    "modules/base/exceptions.py",
    "modules/chat/__init__.py",
    "modules/chat/chat_model.py",
    "modules/chat/memory.py",
    "modules/translation/__init__.py",
    "modules/translation/translator.py",
    "modules/translation/language_detector.py",
    "modules/text/__init__.py",
    "modules/text/generator.py",
    "modules/text/summarizer.py",
    "modules/image/__init__.py",
    "modules/image/text_to_image.py",
    "modules/voice/__init__.py",
    "modules/voice/voice_clone.py",
    "modules/voice/tts.py",
    "modules/voice/stt.py",
    "utils/__init__.py",
    "utils/logger.py",
    "utils/validators.py",
    "services/__init__.py",
    "services/model_manager.py",
    "services/api_service.py",
    "app.py"
)

foreach ($file in $pythonFiles) {
    if (-not(Test-Path $file)) {
        New-Item -ItemType File -Path $file -Force
    }
}

# Create other files
New-Item -ItemType File -Path "web/templates/base.html" -Force
New-Item -ItemType File -Path "config/secrets.json" -Force
New-Item -ItemType File -Path "requirements.txt" -Force

# Create .gitignore if it doesn't exist
if (-not(Test-Path ".gitignore")) {
    @"
# Python
__pycache__/
*.py[cod]
*$py.class

# Virtual Environment
venv/
env/
ENV/

# IDE
.idea/
.vscode/

# Config
config/secrets.json

# Logs
*.log

# Cache
cache/
.cache/

# Distribution
dist/
build/
*.egg-info/

# Local development settings
.env
.env.local
"@ | Out-File -FilePath ".gitignore" -Encoding UTF8
}

Write-Host "Project structure updated successfully!"